from typing import List

"""
189. 轮转数组
https://leetcode.cn/problems/rotate-array/description/?envType=study-plan-v2&envId=top-interview-150
"""
class Solution:
    def rotate(self, nums: List[int], k: int) -> None:
        """
        Do not return anything, modify nums in-place instead.
        """
        n = len(nums)
        i = n - k % n
        nums[:] = nums[i:] + nums[:i]
        print(nums)


if __name__ == "__main__":
    s = Solution()
    nums = [1, 2, 3, 4, 5, 6, 7]
    s.rotate(nums, 10)
